/*
  Get Nth element from the end in a linked list of integers
  Number of elements in the list will always be greater than N.
  Node is defined as 
  struct Node
  {
     int data;
     struct Node *next;
  }
*/
int GetNode(Node *head,int positionFromTail)
{
    // This is a "method-only" submission.
    // You only need to complete this method.
    int n = 0;
    Node *node = head;
    while(node != NULL) {
        n++;
        node = node->next;
    }
    int positionFromHead = n - 1 - positionFromTail;
    for(int i = 0; i < positionFromHead; i++)
        head = head->next;
    return head->data;
}